package com.fau.wmbj.server.entity;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import java.io.Serializable;

/**
 * 商品分类
 *
 * @author jiawei
 * @version 1.0
 * @datetime 2024-03-14 15:25
 */
@Getter
@Setter
@Entity(name = "f_goods_category")
public class GoodsCategory extends BaseEntity<Long> implements Serializable {

    /**
     * 分类名称
     */
    @Column(name = "name", nullable = false)
    private String name;

    /**
     * 层级
     */
    @Column(name = "grade")
    private Integer grade;

    /**
     * 上级
     */
    @ManyToOne
    @JoinColumn(name = "parent_id")
    private GoodsCategory parent;


}
